
const getSectionInfo = (callback) => {
    $.getJSON(GLOBAL_PcateUrl, function(res) {
        callback(res.data);
    });
};
const renderSectionView = (data, defaultid) => {
    let sectionOptionHtml = '<option value="0">请选择</option>';
    $.each(data, (key, val) => {
        let option = `<option value=${val.id}>${val.cate_name}</option>`;
        if (defaultid && parseInt(defaultid, 10) === parseInt(val.id, 10)) {
            option = `<option value=${val.id} selected>${val.cate_name}</option>`;
        }
        sectionOptionHtml += option;
    });
    $('#top_id').html(sectionOptionHtml);
};


export{getSectionInfo,renderSectionView}